/* SingleLOC - Decompiled by JCavaj
 * Visit http://www.bysoft.se/sureshot/jcavaj/
 */
package textui;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.text.DecimalFormat;

import Model.LOCcounter;

public class SingleLOC
{
    private LOCcounter theLOC;
    private boolean doComments = true;
    private String path = "";
    
    public SingleLOC(boolean bool, String string) {
	doComments = bool;
	if (string != null)
	    path = string;
    }
    
    public void countLines(String string) {
	boolean bool = false;
	DecimalFormat decimalformat = new DecimalFormat("00000");
	theLOC = new LOCcounter();
	try {
	    BufferedReader bufferedreader
		= new BufferedReader(new FileReader(path + string));
	    theLOC.setCommentState(doComments);
	    int i = theLOC.getLinesInFile(bufferedreader);
	    System.out.println(decimalformat.format((long) i) + " " + string);
	    bufferedreader.close();
	} catch (IOException ioexception) {
	    System.out.println(ioexception);
	}
    }
}
